import { BaseApiService } from '../base/api.service';

/**
 * 认证服务类
 */
export class AuthService extends BaseApiService {
  constructor() {
    super('/api/auth');
  }

  /**
   * 用户登录
   */
  async login(credentials: { email: string; password: string }): Promise<any> {
    return this.post('login', credentials);
  }

  /**
   * 用户注册
   */
  async register(credentials: any): Promise<any> {
    return this.post('register', credentials);
  }

  /**
   * 忘记密码
   */
  async forgotPassword(email: { email: string }): Promise<any> {
    return this.post('forgot_password', email);
  }

  /**
   * 验证令牌
   */
  async verifyToken(token: { api_token: string }): Promise<any> {
    return this.post('verify_token', token);
  }
}

// 导出单例实例
export const authService = new AuthService();
